package com.jrx.anytxn.reporting.job.lsFile.step;

import com.jrx.anytxn.transaction.constant.TransBizConstant;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 生成还款计划文件 Reader
 *
 * @author liuyang
 * @date 2021-03-13
 */
public class LSNormalRepaymentFileReader extends MyBatisPagingItemReader<Long> {
    public LSNormalRepaymentFileReader(SqlSessionFactory sqlSessionFactory, Integer pageSize, Date startTime) {
        setSaveState(false);
        setPageSize(pageSize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.transaction.mapper.ext.ExtAmRepaymentPlanInfoMapper.selectIdByStatusUpdateTime");
        Map<String, Object> map = new HashMap<>();
        map.put("statusList", Arrays.asList(TransBizConstant.LOAN_PLAN_STATUS_0, TransBizConstant.LOAN_PLAN_STATUS_1,
                TransBizConstant.LOAN_PLAN_STATUS_2));
        map.put("startTime", startTime);
        setParameterValues(map);
    }
}
